package com.xqb.modules.service.impl;

import com.xqb.common.utils.DateUtils;
import com.xqb.modules.domain.po.StdPointsRecord;
import com.xqb.modules.mapper.StdPointsRecordMapper;
import com.xqb.modules.service.IStdPointsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学习积分记录Service业务层处理
 * 
 * @author xqb
 * @date 2024-10-14
 */
@Service
public class StdPointsRecordServiceImpl implements IStdPointsRecordService
{
    @Autowired
    private StdPointsRecordMapper stdPointsRecordMapper;

    /**
     * 查询学习积分记录
     * 
     * @param id 学习积分记录主键
     * @return 学习积分记录
     */
    @Override
    public StdPointsRecord selectStdPointsRecordById(Long id)
    {
        return stdPointsRecordMapper.selectStdPointsRecordById(id);
    }

    /**
     * 查询学习积分记录列表
     * 
     * @param stdPointsRecord 学习积分记录
     * @return 学习积分记录
     */
    @Override
    public List<StdPointsRecord> selectStdPointsRecordList(StdPointsRecord stdPointsRecord)
    {
        return stdPointsRecordMapper.selectStdPointsRecordList(stdPointsRecord);
    }

    /**
     * 新增学习积分记录
     * 
     * @param stdPointsRecord 学习积分记录
     * @return 结果
     */
    @Override
    public int insertStdPointsRecord(StdPointsRecord stdPointsRecord)
    {
        stdPointsRecord.setCreateTime(DateUtils.getNowDate());
        return stdPointsRecordMapper.insertStdPointsRecord(stdPointsRecord);
    }

    /**
     * 修改学习积分记录
     * 
     * @param stdPointsRecord 学习积分记录
     * @return 结果
     */
    @Override
    public int updateStdPointsRecord(StdPointsRecord stdPointsRecord)
    {
        return stdPointsRecordMapper.updateStdPointsRecord(stdPointsRecord);
    }

    /**
     * 批量删除学习积分记录
     * 
     * @param ids 需要删除的学习积分记录主键
     * @return 结果
     */
    @Override
    public int deleteStdPointsRecordByIds(Long[] ids)
    {
        return stdPointsRecordMapper.deleteStdPointsRecordByIds(ids);
    }

    /**
     * 删除学习积分记录信息
     * 
     * @param id 学习积分记录主键
     * @return 结果
     */
    @Override
    public int deleteStdPointsRecordById(Long id)
    {
        return stdPointsRecordMapper.deleteStdPointsRecordById(id);
    }
}
